﻿<!DOCTYPE html>
<html>
<head>
    <!-- 页面meta -->
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>小力健康</title>
    <meta name="description" content="小力健康">
    <meta name="keywords" content="小力健康">
    <meta content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no" name="viewport">
    <!-- 引入样式 -->
    <link rel="stylesheet" href="../plugins/element-ui/lib/theme-chalk/index.css">
    <link rel="stylesheet" href="../plugins/font-awesome/css/font-awesome.min.css">
    <link rel="stylesheet" href="../css/style.css">
    <!-- 引入组件库 -->
    <script type="text/javascript" src="../js/jquery.min.js"></script>
    <script type="text/javascript" src="../js/vue.js"></script>
    <script type="text/javascript" src="../plugins/elementui/index.js"></script>
    <script type="text/javascript" src="../js/axios-0.18.0.js"></script>
    <style>
        .avatar-uploader .el-upload {
            border: 1px dashed #d9d9d9;
            border-radius: 6px;
            cursor: pointer;
            position: relative;
            overflow: hidden;
        }

        .avatar-uploader .el-upload:hover {
            border-color: #409EFF;
        }

        .avatar-uploader-icon {
            font-size: 28px;
            color: #8c939d;
            width: 178px;
            height: 178px;
            line-height: 178px;
            text-align: center;
        }

        .avatar {
            width: 178px;
            height: 178px;
            display: block;
        }

        .datatable {
            position: relative;
            box-sizing: border-box;
            -webkit-box-flex: 1;
            width: 100%;
            max-width: 100%;
            font-size: 14px;
            color: rgb(96, 98, 102);
            overflow: hidden;
            flex: 1 1 0%;
        }

        .datatable td, .datatable th {
            padding: 12px 0;
            min-width: 0;
            -webkit-box-sizing: border-box;
            box-sizing: border-box;
            text-overflow: ellipsis;
            vertical-align: middle;
            position: relative;
            text-align: left;
        }
    </style>
</head>
<body class="hold-transition">
<div id="app">
    <div class="content-header">
        <h1>健康干预<small>干预计划</small></h1>
        <el-breadcrumb separator-class="el-icon-arrow-right" class="breadcrumb">
            <el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
            <el-breadcrumb-item>健康干预</el-breadcrumb-item>
            <el-breadcrumb-item>干预计划</el-breadcrumb-item>
        </el-breadcrumb>
    </div>
    <div class="app-container">
        <div class="box">
            <div class="filter-container">
                <el-input placeholder="档案号/姓名/手机号" v-model="pagination.queryString" style="width: 200px;"
                          class="filter-item" @keyup.enter.native="handleFilter"></el-input>
                <el-button @click="pagination.currentPage=1;findPage()" class="dalfBut">查询</el-button>
            </div>
            <el-table size="small" current-row-key="id" :data="dataList" border stripe highlight-current-row>
                <el-table-column type="index" align="center" label="序号"></el-table-column>
                <el-table-column prop="checkNumber" label="检查号" align="center"></el-table-column>
                <el-table-column prop="memberName" label="姓名" align="center"></el-table-column>
                <el-table-column label="性别" align="center">
                    <template slot-scope="scope">
                        <el-tag v-if="scope.row.sex === '1'" size="small">男</el-tag>
                        <el-tag v-else size="small" type="danger">女</el-tag>
                    </template>
                </el-table-column>
                <el-table-column prop="age" label="年龄" align="center"></el-table-column>
                <el-table-column prop="populationClassificationName" label="人群" align="center"></el-table-column>
                <el-table-column prop="title" label="干预方案标题" align="center"></el-table-column>
                <el-table-column prop="foodInterveneName" label="饮食干预" align="center"></el-table-column>
                <el-table-column prop="sportInterveneName" label="运动干预" align="center"></el-table-column>
                <el-table-column prop="healthInterveneName" label="健康干预" align="center"></el-table-column>
                <el-table-column prop="target" label="目标" align="center" width="190px"></el-table-column>
                <el-table-column prop="interveneStartdate" label="干预开始时间" align="center"></el-table-column>
                <el-table-column prop="interveneEnddate" label="干预结束时间" align="center"></el-table-column>
                <el-table-column label="启用状态" align="center">
                    <template slot-scope="scope">
                        <el-tag v-if="scope.row.interveneStatus === '1'" size="small">启用</el-tag>
                        <el-tag v-else size="small" type="danger">未启用</el-tag>
                    </template>
                </el-table-column>
                <el-table-column prop="doctorName" label="健康管理师" align="center"></el-table-column>
                <el-table-column label="操作" align="center" width="300px">
                    <template slot-scope="scope">
                        <el-button type="primary" size="mini" @click="handleUpload(scope.row)">制定干预方案</el-button>
                        <el-button type="danger" size="mini" @click="handleDeleteFile(scope.row)">删除</el-button>
                        <!--<el-button type="danger" size="mini" @click="handleDelete(scope.row)">删除档案</el-button>-->
                    </template>
                </el-table-column>
            </el-table>

            <div class="pagination-container">
                <el-pagination
                        class="pagiantion"
                        @size-change="handleSizeChange"
                        @current-change="handleCurrentChange"
                        :current-page="pagination.currentPage"
                        :page-sizes="[10, 20, 30, 40, 50]"
                        :page-size="pagination.pageSize"
                        layout="total,sizes, prev, pager, next, jumper"
                        :total="pagination.total">
                </el-pagination>
            </div>
            <!-- 上传标签弹层-->
            <div class="add-form">
                <el-dialog title="健康干预" :visible.sync="dialogFormVisible" v-if="dialogFormVisible">

<!--                    <el-form ref="dataAddForm" :model="formData" :rules="rules" label-position="right"-->
<!--                             label-width="100px">-->
<!--                        <el-row>-->
<!--                            <el-col :span="12">-->
<!--                                <el-form-item label="姓名" prop="name">-->
<!--                                    <el-input v-model="formData.name" disabled/>-->
<!--                                </el-form-item>-->
<!--                            </el-col>-->
<!--                            <el-col :span="12">-->
<!--                                <el-form-item label="档案号" prop="fileNumber">-->
<!--                                    <el-input v-model="formData.fileNumber" disabled/>-->
<!--                                </el-form-item>-->
<!--                            </el-col>-->
<!--                        </el-row>-->
<!--                        <el-row>-->
<!--                            <el-col :span="12">-->
<!--                                <el-form-item label="性别">-->
<!--                                    <el-select v-model="formData.sex" >-->
<!--                                        <el-option label="男" value="1"></el-option>-->
<!--                                        <el-option label="女" value="2"></el-option>-->
<!--                                    </el-select>-->
<!--                                </el-form-item>-->
<!--                            </el-col>-->
<!--                            <el-col :span="12">-->
<!--                                <el-form-item label="手机号">-->
<!--                                    <el-input v-model="formData.phoneNumber" />-->
<!--                                </el-form-item>-->
<!--                            </el-col>-->
<!--                        </el-row>-->
<!--                        <el-row>-->
<!--                            <el-col :span="12">-->
<!--                                <el-form-item label="检查套餐">-->
<!--                                    <el-input v-model="formData.setmealName" disabled/>-->
<!--                                </el-form-item>-->
<!--                            </el-col>-->
<!--                            <el-col :span="12">-->
<!--                                <el-form-item label="体检时间" prop="checkuptime">-->
<!--                                    <el-input v-model="formData.checkuptime" />-->
<!--                                </el-form-item>-->
<!--                            </el-col>-->
<!--                        </el-row>-->
<!--                        <el-row>-->
<!--                            <el-col :span="18">-->
<!--                                <el-form-item label="档案文件" prop="file">-->
<!--                                    <el-upload-->
<!--                                            class="upload-demo"-->
<!--                                            action="/memberupload/uploadFile"-->
<!--                                            :before-remove="beforeRemove"-->
<!--                                            :before-upload="beforeUpload"-->
<!--                                            :limit="1"-->
<!--                                            ref="upload"-->
<!--                                            :on-exceed="handleExceed"-->
<!--                                            :on-success="handSuccess">-->
<!--                                        <el-button size="small" type="primary">点击上传</el-button>-->
<!--                                        <div slot="tip" class="el-upload__tip">文件大小不要超过2MB</div>-->
<!--                                    </el-upload>-->
<!--                                </el-form-item>-->
<!--                            </el-col>-->
<!--                        </el-row>-->
<!--                    </el-form>-->
                    <template>
                        <el-tabs v-model="activeName" type="card">
                            <el-tab-pane label="健康干预" name="first">
                                <el-form ref="dataEditForm" :model="formData" :rules="rules" label-position="right"
                                         label-width="100px">
                                    <el-row>
                                        <el-col :span="12">
                                            <el-form-item label="姓名" prop="memberName">
                                                <el-input v-model="formData.memberName" disabled/>
                                            </el-form-item>
                                        </el-col>
                                        <el-col :span="12">
                                            <el-form-item label="体检号" prop="checkNumber">
                                                <el-input v-model="formData.checkNumber" disabled/>
                                            </el-form-item>
                                        </el-col>
                                    </el-row>
                                    <el-row>
                                        <el-col :span="12">
                                            <el-form-item label="性别">
                                                <el-select v-model="formData.sex" disabled>
                                                    <el-option label="男" value="1"></el-option>
                                                    <el-option label="女" value="2"></el-option>
                                                </el-select>
                                            </el-form-item>
                                        </el-col>
                                        <el-col :span="12">
                                            <el-form-item label="年龄">
                                                <el-input v-model="formData.age" disabled/>
                                            </el-form-item>
                                        </el-col>
                                    </el-row>
                                    <el-row>
                                        <el-col :span="24">
                                            <el-form-item label="方案标题">
                                                <el-input v-model="formData.title" />
                                            </el-form-item>
                                        </el-col>
                                    </el-row>
                                    <el-row>
                                        <el-col :span="12">
                                            <el-form-item label="健康干预">
                                                <el-select v-model="formData.healthInterveneId" placeholder="选择健康方案"
                                                           prop="HealthGroup">
                                                    <el-option
                                                            v-for="HealthGroup in selectHealthList"
                                                            :key="HealthGroup.id"
                                                            :label="HealthGroup.name"
                                                            :value="HealthGroup.id">
                                                    </el-option>
                                                </el-select>
                                            </el-form-item>
                                        </el-col>
                                        <el-col :span="12">
                                            <el-form-item label="运动干预">
                                                <el-select v-model="formData.sportInterveneId" placeholder="选择运动方案"
                                                           prop="SportGroup">
                                                    <el-option
                                                            v-for="SportGroup in selectSportList"
                                                            :key="SportGroup.id"
                                                            :label="SportGroup.name"
                                                            :value="SportGroup.id">
                                                    </el-option>
                                                </el-select>
                                            </el-form-item>
                                        </el-col>
                                    </el-row>
                                    <el-row>
                                        <el-col :span="12">
                                            <el-form-item label="膳食干预">
                                                <el-select v-model="formData.foodInterveneId" placeholder="选择膳食方案"
                                                           prop="FoodGroup">
                                                    <el-option
                                                            v-for="FoodGroup in selectFoodList"
                                                            :key="FoodGroup.id"
                                                            :label="FoodGroup.name"
                                                            :value="FoodGroup.id">
                                                    </el-option>
                                                </el-select>
                                            </el-form-item>
                                        </el-col>
                                    </el-row>
                                    <el-row>
                                        <!--                                        <el-col :span="200">-->
                                        <el-form-item label="目标">
                                            <el-input v-model="formData.target" type="textarea"
                                                      placeholder="默认：无" ></el-input>
                                        </el-form-item>
                                        <!--                                        </el-col>-->
                                    </el-row>
                                    <el-row>
                                        <el-col :span="12">
                                            <el-form-item label="启用状态">
                                                <el-select v-model="formData.interveneStatus" >
                                                    <el-option label="未启用" value="0"></el-option>
                                                    <el-option label="启用" value="1"></el-option>
                                                </el-select>
                                            </el-form-item>
                                        </el-col>
                                    </el-row>
                                    <el-row>
                                        <el-col :span="12">
                                            <el-form-item label="开始时间" prop="interveneStartdate">
                                                <el-date-picker v-model="formData.interveneStartdate" type="datetime"
                                                                value-format="yyyy-MM-dd HH:mm:ss"/>
                                            </el-form-item>
                                        </el-col>
                                        <el-col :span="12">
                                            <el-form-item label="结束时间" prop="interveneEnddate">
                                                <el-date-picker v-model="formData.interveneEnddate" type="datetime"
                                                                value-format="yyyy-MM-dd HH:mm:ss"/>
                                            </el-form-item>
                                        </el-col>
                                    </el-row>
<!--                                    <el-row>-->
<!--                                        <el-col :span="12">-->
<!--                                            <el-form-item label="开始时间" prop="startTime" >-->
<!--                                            <el-date-picker v-model="formData.interveneStartdate"  format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd HH:mm:ss" clearable style="width: 100%"-->
<!--                                                            :picker-options="startDatePicker" :disabled="dialogStatus=='view'" type="datetime"  :placeholder="dialogStatus=='view'?'':'开始时间'"></el-date-picker>-->
<!--                                            </el-form-item>-->
<!--                                        </el-col>-->
<!--                                        <el-col :span="12">-->
<!--                                            <el-form-item label="结束时间" prop="endTime">-->
<!--                                                <el-date-picker v-model="formData.interveneEnddate"  format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd HH:mm:ss" clearable style="width: 100%"-->
<!--                                                                :picker-options="endDatePicker"  :disabled="dialogStatus=='view'" type="datetime"  :placeholder="dialogStatus=='view'?'':'结束时间'"></el-date-picker>-->
<!--                                            </el-form-item>-->
<!--                                        </el-col>-->
<!--                                    </el-row>-->
                                </el-form>
                            </el-tab-pane>
<!--                            <el-tab-pane label="既往史" name="second">-->
<!--                                <el-form  :model="formData" :rules="rules" label-position="right"-->
<!--                                         label-width="50px">-->
<!--                                    <el-row>-->
<!--&lt;!&ndash;                                        <el-col :span="200">&ndash;&gt;-->
<!--                                            <el-form-item label="说明">-->
<!--                                                <el-input v-model="formData.pastHistory" type="textarea"-->
<!--                                                          placeholder="默认：无" style="height: 800px"></el-input>-->
<!--                                            </el-form-item>-->
<!--&lt;!&ndash;                                        </el-col>&ndash;&gt;-->
<!--                                    </el-row>-->
<!--                                </el-form>-->

<!--                            </el-tab-pane>-->
<!--                            <el-tab-pane label="家族史" name="third">-->
<!--                                <el-form  :model="formData" :rules="rules" label-position="right"-->
<!--                                         label-width="50px">-->
<!--                                    <el-row>-->
<!--                                        &lt;!&ndash;                                        <el-col :span="200">&ndash;&gt;-->
<!--                                        <el-form-item label="说明">-->
<!--                                            <el-input v-model="formData.familyHistory" type="textarea"-->
<!--                                                      placeholder="默认：无" style="height: 800px"></el-input>-->
<!--                                        </el-form-item>-->
<!--                                        &lt;!&ndash;                                        </el-col>&ndash;&gt;-->
<!--                                    </el-row>-->
<!--                                </el-form>-->

<!--                            </el-tab-pane>-->
<!--                            <el-tab-pane label="过敏史" name="fourth">-->
<!--                                <el-form  :model="formData" :rules="rules" label-position="right"-->
<!--                                         label-width="50px">-->
<!--                                    <el-row>-->
<!--                                        &lt;!&ndash;                                        <el-col :span="200">&ndash;&gt;-->
<!--                                        <el-form-item label="说明">-->
<!--                                            <el-input v-model="formData.allergyHistory" type="textarea"-->
<!--                                                      placeholder="默认：无" style="height: 800px"></el-input>-->
<!--                                        </el-form-item>-->
<!--                                        &lt;!&ndash;                                        </el-col>&ndash;&gt;-->
<!--                                    </el-row>-->
<!--                                </el-form>-->

<!--                            </el-tab-pane>-->
<!--                            <el-tab-pane label="分析结果" name="fifth">-->
<!--                                <el-form  :model="formData" :rules="rules" label-position="right"-->
<!--                                          label-width="50px">-->
<!--                                    <el-row>-->
<!--                                        &lt;!&ndash;                                        <el-col :span="200">&ndash;&gt;-->
<!--                                        <el-form-item label="说明">-->
<!--                                            <el-input v-model="formData.examinationResult" type="textarea"-->
<!--                                                      placeholder="默认：无" style="height: 800px"></el-input>-->
<!--                                        </el-form-item>-->
<!--                                        &lt;!&ndash;                                        </el-col>&ndash;&gt;-->
<!--                                    </el-row>-->
<!--                                </el-form>-->

<!--                            </el-tab-pane>-->
                        </el-tabs>
                    </template>
                    <div slot="footer" class="dialog-footer">
                        <el-button @click="dialogFormVisible = false">取消</el-button>
                        <el-button type="primary" @click="handleAdd()">确定</el-button>
                    </div>
                </el-dialog>
            </div>
        </div>
    </div>
</div>
</body>
<script type="text/javascript">

    var Main = {
        data() {
            return {
                pagination: {//分页相关属性
                    currentPage: 1,  //当前页
                    pageSize: 10,  //一页显示的数量
                    total: 100,  //总数
                    queryString: null //查询条件
                },
                dataList: [],//列表数据
                selectHealthList: [],//健康方案数据
                selectSportList: [],//运动方案数据
                selectFoodList: [],//膳食方案数据
                formData: {
                    sex: '不限'
                },//表单数据
                tableData: [],//添加表单窗口中检查组列表数据
                dialogFormVisible: false,//控制增加窗口显示/隐藏
                activeName: 'first',
                dataAddForm: {
                    file: ''
                },
                rules: {
                    name: [{required: true, message: '用户名称为必填项', trigger: 'blur'}],
                    fileNumber: [{required: true, message: '档案编号为必填项', trigger: 'blur'}],
                    orderDate: [{required: true, message: '体检日期为必填项', trigger: 'blur'}],
                    //文件验证
                    file: [
                        {required: true, message: '请上传文件', trigger: 'blur'},
                    ]
                },
            }
        },
        created() {
            this.findPage();
        },
        methods: {
            //日期转换
            dateFormat: function (time) {
                var date = new Date(time);
                var year = date.getFullYear();
                /* 在日期格式中，月份是从0开始的，因此要加0
                 * 使用三元表达式在小于10的前面加0，以达到格式统一  如 09:11:05
                 * */
                var month = date.getMonth() + 1 < 10 ? "0" + (date.getMonth() + 1) : date.getMonth() + 1;
                var day = date.getDate() < 10 ? "0" + date.getDate() : date.getDate();
                // 拼接
                return year + "-" + month + "-" + day;
            },
            showMessage(r) {
                if (r == 'Error: Request failed with status code 403') {
                    //权限不足
                    this.$message.error('无访问权限');
                    return;
                } else {
                    this.$message.error('未知错误');
                    return;
                }
            },
            //个数限制提示
            handleExceed() {
                this.$message.warning(`只能选择一个文件，请删除刚才的文件`);
            },
            //下载报告文件
            downloadTemplate(url) {
                if(url === ''|| url === null || url === ""){
                    this.$message.error('体检报告未上传，请先上传体检报告');
                }else{
                    window.location.href = url;
                }

            },
            //上传成功时
            handSuccess(response,file) {
                //手动取消为空验证
                this.rules.file[0].required = false;
                //设置模型数据（图片名称），后续提交ajax请求时会提交到后台最终保存到数据库
                this.formData.fileurl = response.data;
            },
            //上传文件之前执行
            beforeUpload(file) {
                const isLt2M = file.size / 1024 / 1024 < 2;
                if (!isLt2M) {
                    this.$message.error('上传套餐图片大小不能超过 2MB');
                }
            },
            //删除文件提示
            beforeRemove(file) {
                return this.$confirm(`确定移除 ${file.name}？`);
            },
            //弹出上传页面
            handleUpload(row) {
                this.formData={};
                this.resetRules('dataAddForm');
                this.dialogFormVisible = true;
                axios.get('/populationclassification/findById?id=' + row.id).then((res) => {
                    if (res.data.flag) {
                        res.data.data.checkuptime = this.dateFormat(res.data.data.checkuptime);
                        this.formData = res.data.data;
                    } else {
                        this.$message.error(res.data.message);
                    }
                }).catch((res) => {
                    this.showMessage(res);
                });

                //查询运动、健康、膳食方案
                axios.post("/populationclassification/getSportsAndFoodAndHealthDetail").then((res) => {
                    if (res.data.flag) {
                        //this.selectList = res.data.data;
                        this.selectHealthList=res.data.data.healthGroups
                        this.selectSportList=res.data.data.sportGroups
                        this.selectFoodList=res.data.data.foodGroups
                    } else {
                        this.$message.error(res.data.message);
                    }
                }).catch((res) => {
                    this.showMessage(res);
                });
            },
            //上传报告
            handleAdd() {
                // this.$refs['dataAddForm'].validate((valid) => {
                //     if (valid) {
                //         axios.post('/memberupload/uploadFileReport', this.formData).then((res) => {
                //             if (res.data.flag) {
                //                 this.$message.success(res.data.message);
                //             } else {
                //                 this.$message.error(res.data.message);
                //             }
                //         }).catch((res) => {
                //             this.showMessage(res);
                //         }).finally(() => {
                //             this.findPage();
                //             this.$refs.upload.clearFiles();//清除上传列表
                //             this.dialogFormVisible = false;
                //         });
                //     }
                // });
                for (var newStrId of JSON.parse(JSON.stringify(this.selectHealthList))) {
                    if (newStrId['id'] === this.formData['healthInterveneId']) {
                        this.formData.healthInterveneName = newStrId['name'];
                        // console.log(newStrId['id'])
                    }
                }
                for (var newStrId of JSON.parse(JSON.stringify(this.selectSportList))) {
                    if (newStrId['id'] === this.formData['sportInterveneId']) {
                        this.formData.sportInterveneName = newStrId['name'];
                            // console.log(newStrId['id'])
                    }
                }
                for (var newStrId of JSON.parse(JSON.stringify(this.selectFoodList))) {
                    if (newStrId['id'] === this.formData['foodInterveneId']) {
                        this.formData.foodInterveneName = newStrId['name'];
                                // console.log(newStrId['id'])
                    }
                }
                    //发送ajax请求，将修改后的表单数据（检查组基本信息、勾选的检查项）提交到后台进行处理
                    axios.post("/populationclassification/edit", this.formData).then((res) => {
                        //关闭编辑窗口
                        this.dialogFormVisible = false;
                        if (res.data.flag) {
                            this.$message.success(res.data.message);
                            //重新进行分页查询
                            this.findPage();
                        } else {
                            //操作失败
                            this.$message.error(res.data.message);
                        }
                    }).catch((res) => {
                        this.showMessage(res);
                    }).finally(() => {
                        //重新进行分页查询
                        // this.findPage();
                    });
            },
            //分页查询
            findPage() {
                var param = {
                    currentPage: this.pagination.currentPage,
                    pageSize: this.pagination.pageSize,
                    queryString: this.pagination.queryString
                };
                //发送ajax请求，进行分页查询
                axios.post("/populationclassification/findPage", param).then((res) => {
                    this.pagination.total = res.data.total;
                    /*循环更改日期格式*/
                    for (i in res.data.rows) {
                        res.data.rows[i].checkuptime = this.dateFormat(res.data.rows[i].checkuptime);
                    }
                    this.dataList = res.data.rows;
                });
            },
            /*//删除档案
            handleDelete(row) {
                if (row.filestatus === '1') {
                    this.$message.error('无法删除已经报告的体检信息');
                    return;
                }
                //弹出确认框
                this.$confirm('此操作将永久删除当前档案数据, 是否继续?', '提示', {
                    confirmButtonText: '确定',
                    cancelButtonText: '取消',
                    type: 'warning'
                }).then(() => {
                    //发送ajax请求，将id提交到Controller
                    axios.get("/memberupload/delete.do?id=" + row.id).then((res) => {
                        if (res.data.flag) {
                            this.$message.success(res.data.message);
                        } else {
                            this.$message.error(res.data.message);
                        }
                    }).catch((r) => {
                        this.showMessage(r);
                    }).finally(() => {
                        this.findPage();
                    });
                }).catch(() => {
                    this.$message("已取消");
                });
            },*/
            //删除报告
            handleDeleteFile(row) {
                //弹出确认框
                this.$confirm('此操作将永久删除该用户健康干预计划, 是否继续?', '提示', {
                    confirmButtonText: '确定',
                    cancelButtonText: '取消',
                    type: 'warning'
                }).then(() => {
                    //发送ajax请求，将id提交到Controller
                    if (row.filestatus !== '1') {
                        this.$message.error('报告未上传无法删除');
                        return;
                    }
                    axios.get("/populationclassification/deleteFileReport?id=" + row.id).then((res) => {
                        if (res.data.flag) {
                            this.$message.success(res.data.message);
                        } else {
                            this.$message.error(res.data.message);
                        }
                    }).catch((r) => {
                        this.showMessage(r);
                    }).finally(() => {
                        this.findPage();
                    });
                }).catch(() => {
                    this.$message("已取消");
                });
            },
            // 重置表单
            resetForm() {
                if (this.$refs.upload !== undefined) {
                    this.$refs.upload.clearFiles()
                }
            },
            //重置验证
            resetRules(formName) {
                if (this.$refs[formName] !== undefined) {
                    this.$refs[formName].resetFields()
                }
            },
            // 初始页currentPage、初始每页数据数pagesize和数据data
            handleSizeChange(size) {
                this.pagination.pageSize = size;
                this.findPage();
            },
            //切换页码
            handleCurrentChange(currentPage) {
                this.pagination.currentPage = currentPage;//指定最新的页码
                this.findPage();
            }
        }
    }
    var Ctor = Vue.extend(Main)
    new Ctor().$mount('#app')

</script>
</html>
